<?php

use League\CommonMark\CommonMarkConverter;

require_once __DIR__.'/../../init.php';



?>

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ul-free-free-map 开源免费地图解决方案</title>

</head>

<body>
    <?php include PUBLIC_PATH.'/header.php' ?>
    <?php include PUBLIC_PATH.'/left.php' ?>

    <div class="main-code">
        <?php include PUBLIC_PATH.'/initMap.php'?>
        <script>
            map.on('locationfound', function(e) {
                console.log(e);

                $('.message').text('您当前的位置：' + e.latlng.lat + ',' + e.latlng.lng)
                map.flyTo(e.latlng, 16)
                L.marker(e.latlng).addTo(map)
            })
            map.on('locationerror', function(e) {
                console.log(e);
                $('.message').text('获取您的位置失败，请检查您的网络或地理位置服务是否开启')
            })
            map.locate()
            $('.message').text('获取您的位置中...').show()
        </script>
    </div>
</body>

</html>